<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/calendar.css">
</head>
<style>
    html {
	font: 500 14px 'roboto';
	color: #333;
	background-color: #fafafa;
}
a {
	text-decoration: none;
}
ul, ol, li {
	list-style: none;
	padding: 0;
	margin: 0;
}
#demo {
	width: 300px;
	margin: 150px auto;
}
p {
	margin: 0;
}
#dt {
	margin: 30px auto;
	height: 28px;
	width: 200px;
	padding: 0 6px;
	border: 1px solid #ccc;
	outline: none;
}
</style>
<body>
    <div id="demo">
    <div id="ca" ></div>
    </div>
    <input type="datetime" id="input-cal">
</body>
<script src="../作用域/jquery.js"></script>
<!--日历js是基于jQuery的所以先引进jQuery否则效果无法实现-->
<script src="../作用域/calendar.js"></script>
<script>
    $("#ca").calendar({
        width: 320,
        height: 200,
        prev: "<",
        next: ">",
        onSelected:function(view,date,data){
            console.log(view);
            console.log(date);
            console.log(data);
            $("#inpt-cal").val(date)
        }
    })
</script>

</html>